real function numerator(a,n,avex)
    !real numerator
    dimension a(n)
    integer i,n
    !real a(1:n)
    numerator=0

    do 20, i=1,n
        numerator=numerator+(avex-a(i))**3
    20 continue

end function

real function denorminator(a,n,avex)
    !real denorminator
    dimension a(n)
    integer i,n
    denorminator=0

    do 30, i=1,n
        denorminator=denorminator+(avex-a(i))**2
    30 continue

    denorminator=(sqrt(denorminator/(n-1)))**3*n
end function

program chapter11_4
    implicit none
    integer n,i
    real numerator,denorminator
    real a(100)
    real s,avex
    print *, 'how many numbers in this formula, n'
    read (*, *) n
    i=1
    s=0

    print *, 'please input every element'
    do 10, i=1,n
        read (*, *) a(i)
        s=s+a(i)
    10 continue

    avex=s/n
    print *, 'avex=',avex
    do i=1,n
        print *, a(i)
    end do
    do i=1,n
        print *, a(i)-avex
    end do
    print *,'numerator=',numerator(a,n,avex)
    print *, 'denorminator=',denorminator(a,n,avex)
    print*, 'outcome=', numerator(a,n,avex)/denorminator(a,n,avex)
end program

